import 'package:flutter/material.dart';

class Button extends MaterialButton {
  Button({
    super.key,
    super.onPressed,
    Color? backgroundColor,
    Color? fontColor,
    double? fontSize,
    super.height,
    String? label,
    Color? borderColor,
    IconData? icon,
    Color? iconColor,
    double? iconSize,
    FontWeight? fontWeight,
    double? circular
  }) : super(
          elevation: 0,
          shape:  RoundedRectangleBorder(
              side: BorderSide(color: borderColor??Colors.white),
              //边框圆角
              borderRadius: BorderRadius.all(
                Radius.circular(circular??10),
              )
          ),
          color: backgroundColor?? const Color.fromARGB(255, 60, 98, 60),
          child: icon != null ? Row(
            mainAxisSize: MainAxisSize.min,
            children: [
              Icon(icon, size: iconSize??20, color: iconColor??const Color.fromARGB(255, 133, 133, 133)),
              Text(
                label??'按钮',
                style: TextStyle(
                    fontWeight: fontWeight??FontWeight.w500,
                    fontSize: fontSize ?? 14,
                    color: fontColor ?? const Color.fromARGB(255, 255, 255, 255)
                ),
              ),
            ],
          ) : Text(
            label??'按钮',
            style: TextStyle(
                fontWeight: fontWeight??FontWeight.w500,
                fontSize: fontSize ?? 14,
                color: fontColor ?? const Color.fromARGB(255, 255, 255, 255)),
          ),
        );
}
